from django.db import models
from datetime import datetime
# Create your models here.
#class Stu(models.Model):
#     id = models.AutoField(primary_key=True)
#     name = models. CharField(max_length=16)
#     age = models.SmallIntegerField()
#     sex = models.CharField(max_length=1)
#     classid = models.CharField(max_length=8)
#
#
#     #定义默认输出格式
#     def __str__(self):
#         return "%d:%s:%d:%s:%s"%(self.id, self.name, self.age, self.sex, self.classid)
#
#     #定义对应的表名 默认myapp_stu
#     class Meta:
#         db_table = "stu"
#         verbose_name = '游览学生信息'
#         verbose_name_plural = "学生信息管理"

class Users(models.Model):
    #id = models.AutoField(primary_key=True)
    name = models. CharField(max_length=32)
    age = models.IntegerField(default=20)
    phone = models.CharField(max_length=16)
    addtime = models.DateTimeField(default=datetime.now)

    class Meta:
        db_table = "myapp_users"
